<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" >

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript" th:src="@{/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
<script type="text/javascript" th:src="@{/bootstrap-treeview/bootstrap-treeview.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootstrap-treeview/bootstrap-treeview.min.css}">
<script type="text/javascript" th:src="@{/bootStrap-addTabs/bootstrap.addtabs.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootStrap-addTabs/bootstrap.addtabs.css}">
<script type="text/javascript" th:src="@{/bootstrap-table/bootstrap-table.min.js}"></script>
<script type="text/javascript" th:src="@{/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"></script>
<link type="text/css" rel="stylesheet" th:href="@{/bootstrap-table/bootstrap-table.min.css}">

<script type="text/javascript" th:src="@{/bootstrap-fileinput/js/fileinput.min.js}"></script>
<script th:src="@{/bootstrap-fileinput/js/locales/zh.js}"></script>
<body>





        <div class="modal-content">
            <div class="modal-header">
                <button data-dismiss="modal" class="close" type="button"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
            </div>
            <!--===================================================================================  -->
            <div class="modal-body">
                <form id="myForm1" class="form-horizontal">
                    <input type="hidden" id="id" class="form-control" name="id"> <br>
                    积分事项<input type="text" class="form-control"  name="xstitle" id="xstitle">
                    申请分数<input type="text" class="form-control" name="xsintegral" id="xsintegral">
                    奖扣对象<input type="text" class="form-control" name="name" id="name"><button onclick="initUserList()"></button>
                    @审核人<input type="text" class="form-control" name="adminName" id="adminName">
                    申请内容<textarea name="xscontent"  id="xscontent"></textarea>
                </form>
            </div>

            <!--===================================================================================  -->
            <div class="modal-footer">
                <button class="btn btn-primary" type="button" onclick="sub()">申请</button>
            </div>
        </div>


</body>
<script>

    $(function (){
        geilistid();
    })


    function sub(){
        $.ajax({
            url:"/Sq/add",
            type:"post",
            data:$("#myForm1").serialize(),
            dataType:"json",
            success:function(){
              window.location.href="sqwc.html";
            },error:function(){
                // alert("成功")
                // $('#myTable').bootstrapTable('refresh');//刷新表格
                // $("#addLayer").modal('hide'); //关闭弹窗
            }
        })
    }

    function  geilistid(){
        var fid=sessionStorage.getItem("fid")
        $.ajax({
            url:"Sq/getjfId",
            data:{id:fid},
            success:function(data){
                $("#xstitle").val(data.xstitle);
                $("#xsintegral").val(data.xsintegral);
                $("#name").val(data.name);
                $("#adminName").val(data.adminName);
            }
        })
    }


    function initUserList(){
        $.ajax({
            url:"Sq/getUserList1",
            success:function(data){

            }
        })


    }









</script>
</html>